package com.jumi.microservice.dto;

import com.jumi.microservice.common.base.dto.BaseRequest;
import com.jumi.microservice.constant.PayChannelEnum;
import com.jumi.microservice.constant.UnionPayWayEnum;
import io.swagger.annotations.ApiModelProperty;

import java.math.BigDecimal;

/**
 * @author Dirk
 * @Date 2020-07-20 14:13
 */
public class PaymentRequest extends BaseRequest {

    private static final long serialVersionUID = 171447907403768262L;

    @ApiModelProperty(value = "uid", hidden = true)
    private Long uid;

    @ApiModelProperty(value = "支付渠道", required = true)
    private PayChannelEnum payChannel;

    @ApiModelProperty(value = "支付单号", required = true)
    private String paymentSn;

    @ApiModelProperty(value = "订单金额", hidden = true)
    private BigDecimal totalAmount;

    @ApiModelProperty(value = "订单描述", hidden = true)
    private String subject;

    @ApiModelProperty(value = "客户端IP", hidden = true)
    private String clientIp;

    @ApiModelProperty(value = "聚合支付方式", hidden = true)
    private UnionPayWayEnum payWay;

    @ApiModelProperty("微信openId: 小程序、H5必传")
    private String openId;

    @ApiModelProperty("支付宝H5使用：" +
            "公用回传参数，如果请求时传递了该参数，则返回给商户时会回传该参数。" +
            "支付宝会在异步通知时将该参数原样返回。" +
            "本参数必须进行 UrlEncode 之后才可以发送给支付宝。")
    private String passbackParams;

    public Long getUid() {
        return uid;
    }

    public void setUid(Long uid) {
        this.uid = uid;
    }

    public PayChannelEnum getPayChannel() {
        return payChannel;
    }

    public void setPayChannel(PayChannelEnum payChannel) {
        this.payChannel = payChannel;
    }

    public String getPaymentSn() {
        return paymentSn;
    }

    public void setPaymentSn(String paymentSn) {
        this.paymentSn = paymentSn;
    }

    public BigDecimal getTotalAmount() {
        return totalAmount;
    }

    public void setTotalAmount(BigDecimal totalAmount) {
        this.totalAmount = totalAmount;
    }

    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }

    public String getClientIp() {
        return clientIp;
    }

    public void setClientIp(String clientIp) {
        this.clientIp = clientIp;
    }

    public UnionPayWayEnum getPayWay() {
        return payWay;
    }

    public void setPayWay(UnionPayWayEnum payWay) {
        this.payWay = payWay;
    }

    public String getOpenId() {
        return openId;
    }

    public void setOpenId(String openId) {
        this.openId = openId;
    }

    public String getPassbackParams() {
        return passbackParams;
    }

    public void setPassbackParams(String passbackParams) {
        this.passbackParams = passbackParams;
    }

    @Override
    public String toString() {
        return "PaymentRequest{" +
                "uid=" + uid +
                ", payChannel=" + payChannel +
                ", paymentSn='" + paymentSn + '\'' +
                ", totalAmount=" + totalAmount +
                ", subject='" + subject + '\'' +
                ", clientIp='" + clientIp + '\'' +
                ", payWay=" + payWay +
                ", openId='" + openId + '\'' +
                ", passbackParams='" + passbackParams + '\'' +
                '}';
    }
}
